<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <meta name=”Keywords” Content=”火星翻译″/>
    <meta name=”Description” Content=”你网页的简述”/>
    <title>Document</title>
    <script src="F:\js\jstest\js\jquery-2.1.4.min.js"></script>
    <style>
    html,
    body,
    div {
        padding: 0;
        margin: 0;
    }

    li {
        list-style: none;
    }


    .clear-fix {
        clear: both;
    }
    </style>
</head>

<body>
    <!-- div#container.container tab -->
    <div class="container" id="container">
        <!-- ur>li.item*5 tab -->
        <ul>
            <li class="item">
            </li>
            <li class="item">2</li>
            <li class="item">3</li>
            <li class="item">3</li>
            <li class="item">5</li>
            <li class="item">4</li>
            <li class="item">5</li>
            <li class="item">5</li>
        </ul>
    </div>
</body>
<script type="text/javascript">
function Parent() {
    console.log(this.des);
}
Parent.prototype = {
    "des": "des parent"
};

function Child() {
    this.des = "des child"
    console.log("child");
    Parent.call(this);
    console.log(new Parent().des);
}

function extends1(subclass, superclass) {
    subclass.prototype = new superclass();
}
//建议的做法
function extends2(subClass, superClass) {
    let F = function() {};
    F.prototype = superClass.prototype;
    subClass.prototype = new F();
    subClass.prototype.constructor = subClass;

    subClass.superclass = superClass.prototype;
    if (superClass.prototype.constructor == Object.prototype.constructor) {
        superClass.prototype.constructor = superClass;
    }
}

//为什么不用这个
function extends3(subclass, superclass) {
    subclass.prototype = superclass.prototype;
}


extends2(Child, Parent);


new Child();
</script>

</html>